﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class ElementCollectionExtensions
    {
        public static bool Exists(this ElementCollection elementCollection, string elementIdOrNameOrValueorClass, bool extension = true)
        {
            return elementCollection.Exists(Find.ById(elementIdOrNameOrValueorClass)) ||
                elementCollection.Exists(Find.ByName(elementIdOrNameOrValueorClass)) ||
                elementCollection.Exists(Find.ByValue(elementIdOrNameOrValueorClass)) ||
                elementCollection.Exists(Find.ByClass(elementIdOrNameOrValueorClass)) ||
                elementCollection.Exists(Find.ByLabelText(elementIdOrNameOrValueorClass));
        }
    }
}